<template>
  <div class="app-container">
    <el-row :gutter="6">
      <el-col :span="12">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>一级分类</span>
          </div>
          <div class="item">
            <label-first @refreshSubView="refreshSubView" />
          </div>
        </el-card>

      </el-col>
      <el-col :span="12">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>[{{ labelName }}]</span>
          </div>
          <div class="item">
            <label-second ref="labelSecond" />
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import labelFirst from './components/labelFirst'
import labelSecond from './components/labelSecond'

export default {
  name: 'labelClass',
  components: { labelFirst, labelSecond },
  data() {
    return {
      labelName: '未选择'
    }
  },
  methods: {
    refreshSubView(row) {
      console.log('row',row)
      this.labelName = row.labelName
      this.$refs.labelSecond.refreshSubView(row)
    }
  }
}
</script>
